package main

import (
	"fmt"
	"os"
	"strings"
)

var f = "D:/xcz"
var num1 = 0
var t = "* * "

func tree(n string, i int) {
	i++
	dir, err := os.ReadDir(n)
	for _, file := range dir {
		if err != nil {
			fmt.Println(strings.Repeat(t, i), file.Name())
		} else {
			fmt.Println(strings.Repeat(t, i), file.Name())
			str := fmt.Sprintf("%s/%s", n, file.Name())
			tree(str, i)
		}
	}
}

func main() {
	tree(f, num1)
}
